﻿namespace Windows32
{
    using System;
    using System.Runtime.InteropServices;

    public sealed class StockObject
    {
        private StockObject()
        {
        }

        [DllImport("gdi32")]
        private static extern IntPtr GetStockObject(_StockObjectType fnObject);

        public static IntPtr ANSI_FIXED_FONT
        {
            get
            {
                return GetStockObject(_StockObjectType.ANSI_FIXED_FONT);
            }
        }

        public static IntPtr ANSI_VAR_FONT
        {
            get
            {
                return GetStockObject(_StockObjectType.ANSI_VAR_FONT);
            }
        }

        public static IntPtr BLACK_BRUSH
        {
            get
            {
                return GetStockObject(_StockObjectType.BLACK_BRUSH);
            }
        }

        public static IntPtr BLACK_PEN
        {
            get
            {
                return GetStockObject(_StockObjectType.BLACK_PEN);
            }
        }

        public static IntPtr DC_BRUSH
        {
            get
            {
                return GetStockObject(_StockObjectType.DC_BRUSH);
            }
        }

        public static IntPtr DC_PEN
        {
            get
            {
                return GetStockObject(_StockObjectType.DC_PEN);
            }
        }

        public static IntPtr DEFAULT_GUI_FONT
        {
            get
            {
                return GetStockObject(_StockObjectType.DEFAULT_GUI_FONT);
            }
        }

        public static IntPtr DEFAULT_PALETTE
        {
            get
            {
                return GetStockObject(_StockObjectType.DEFAULT_PALETTE);
            }
        }

        public static IntPtr DEVICE_DEFAULT_FONT
        {
            get
            {
                return GetStockObject(_StockObjectType.DEVICE_DEFAULT_FONT);
            }
        }

        public static IntPtr DKGRAY_BRUSH
        {
            get
            {
                return GetStockObject(_StockObjectType.DKGRAY_BRUSH);
            }
        }

        public static IntPtr GRAY_BRUSH
        {
            get
            {
                return GetStockObject(_StockObjectType.GRAY_BRUSH);
            }
        }

        public static IntPtr HOLLOW_BRUSH
        {
            get
            {
                return GetStockObject(_StockObjectType.NULL_BRUSH);
            }
        }

        public static IntPtr LTGRAY_BRUSH
        {
            get
            {
                return GetStockObject(_StockObjectType.LTGRAY_BRUSH);
            }
        }

        public static IntPtr NULL_BRUSH
        {
            get
            {
                return GetStockObject(_StockObjectType.NULL_BRUSH);
            }
        }

        public static IntPtr NULL_PEN
        {
            get
            {
                return GetStockObject(_StockObjectType.NULL_PEN);
            }
        }

        public static IntPtr OEM_FIXED_FONT
        {
            get
            {
                return GetStockObject(_StockObjectType.OEM_FIXED_FONT);
            }
        }

        public static IntPtr SYSTEM_FIXED_FONT
        {
            get
            {
                return GetStockObject(_StockObjectType.SYSTEM_FIXED_FONT);
            }
        }

        public static IntPtr SYSTEM_FONT
        {
            get
            {
                return GetStockObject(_StockObjectType.SYSTEM_FONT);
            }
        }

        public static IntPtr WHITE_BRUSH
        {
            get
            {
                return GetStockObject(_StockObjectType.WHITE_BRUSH);
            }
        }

        public static IntPtr WHITE_PEN
        {
            get
            {
                return GetStockObject(_StockObjectType.WHITE_PEN);
            }
        }

        private enum _StockObjectType
        {
            ANSI_FIXED_FONT = 11,
            ANSI_VAR_FONT = 12,
            BLACK_BRUSH = 4,
            BLACK_PEN = 7,
            DC_BRUSH = 0x12,
            DC_PEN = 0x13,
            DEFAULT_GUI_FONT = 0x11,
            DEFAULT_PALETTE = 15,
            DEVICE_DEFAULT_FONT = 14,
            DKGRAY_BRUSH = 3,
            GRAY_BRUSH = 2,
            HOLLOW_BRUSH = 5,
            LTGRAY_BRUSH = 1,
            NULL_BRUSH = 5,
            NULL_PEN = 8,
            OEM_FIXED_FONT = 10,
            SYSTEM_FIXED_FONT = 0x10,
            SYSTEM_FONT = 13,
            WHITE_BRUSH = 0,
            WHITE_PEN = 6
        }
    }
}

